package com.hxd.otc.common.enums;

/**
 * Created by lzy on 2018/6/14 0014.
 * description ${TODO}
 * <p>
 * Changed by somebody on 2018/6/14 0014
 * description ${TODO}
 */
public enum  Currency {
    CNY(0,"CNY"),USD(1,"USD"),EUR(2,"EUR"),HKD(3,"HKD"),TWD(4,"TWD");

    private final int code;
    private final String content;

    Currency(int code, String content) {
        this.code = code;
        this.content = content;
    }

    public static Currency getCurrencyByContent(String content) {
        switch (content.toUpperCase()) {
            case "USD":
                return USD;
            case "EUR":
                return EUR;
            case "HKD":
                return HKD;
            case "TWD":
                return TWD;
            case "CNY":
            default:
                return CNY;
        }
    }

    public int getCode() {
        return code;
    }

    public String getContent() {
        return content;
    }
}
